package light.head.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Formula;

/**
 * @author 简航
 * 创建日期 2009-11-25 10:14:09
 * 权限
 * 主要操作的DAO为：RoleDAO
 */
@Entity
@Table
public class Role implements Serializable {
	
	private static final long serialVersionUID = -1809760562440218355L;
	

	private Integer code;					// 权限流水号
	private String name;					// 权限名称
	private String remark;					// 备注
	private Boolean isDefault = false;				// 是否默认权限
	private Boolean deleted;				// 是否删除
	
	private Integer oc;						// 组织机构流水号
	private Date ct;						// 创建时间
	private Integer cu;						// 创建人
	
	private String ocn;						//机构名称
	private String operating;				//可做操作
	private Integer basicWage;				//基本工资







	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	
	@Column(length = 20)
	public String getName() {
		return name;
	}
	
	@Column
	public Integer getOc() {
		return oc;
	}
	
	@Column(columnDefinition="varchar(1000)")
	public String getRemark() {
		return remark;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}

	@Column
	public Boolean getIsDefault() {
		return isDefault;
	}
	
	@Column
	public Boolean getDeleted() {
		return deleted;
	}
	
	@Column
	public Integer getCu() {
		return cu;
	}
	@Column
	public String getOperating() {
		return operating;
	}
	@Column
	public Integer getBasicWage() {
		return basicWage;
	}

	@Formula("(SELECT o.name FROM Organ o WHERE o.code = oc)")
	public String getOcn() {
		return ocn;
	}	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	

	public void setCode(Integer code) {
		this.code = code;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setOc(Integer oc) {
		this.oc = oc;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}
	public void setDeleted(Boolean deleted) {
		this.deleted = deleted;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setOcn(String ocn) {
		this.ocn = ocn;
	}

	public void setOperating(String operating) {
		this.operating = operating;
	}

	public void setBasicWage(Integer basicWage) {
		this.basicWage = basicWage;
	}
	
}
